#include <iostream>
using std::cout;
using std::endl;

class Point
{
public:
    Point(int x ,int y)
    : _ix(x)
    , _iy(y)
    {
        cout << "Point(int,int)" << endl;
    }

    Point(const Point & rhs)
    : _ix(rhs._ix)
    , _iy(rhs._iy)
    {
        cout << "Point(const Point &)" << endl;
    }
    

    void print(){
        cout << "(" << _ix
            << "," << _iy
            << ")" << endl;
    }

    ~Point(){
        cout << "~Point()" << endl;
    }
private:
    int _ix;
    int _iy;
};

void test0(){
    int x = 1;
    int y = x;
    cout << y << endl;
    
    Point pt(1,2);
    Point pt2 = pt;
    //可以按下面这种形式理解拷贝构造函数的调用
    //为了与内置类型的使用保持一致，通常用=进行复制
    /* Point pt2(pt); */
    pt2.print();
}

int main(void){
    test0();
    return 0;
}
